const common = require('./common');

module.exports = class {

    constructor() {
      this.apis = [
        {
          'method': 'POST',
          'name': 'auth',
          'desc': '登录验证(errcode == 505 需要验证码)',
          'group': '!Login',
          'url': 'https://xxx/api/v1/auth',
          'is_json_params': true,
          'params': [
            ['app_id', 0, 'app_id'],
            ['plat_id', 0, '渠道id 1:游客'],
            ['data', '', 'channel=1时传客户端本地生成的id'],
          ],
          'response': [
            new common.RspHead(),
            ['access_token', '', 'access_token JWT格式'],
            ['refresh_token', '', '刷新令牌'],
            ['expires_in', 0, 'access_token有效期'],
            ['server_time', 0, '服务器utc时间'],
            ['aid', '', '账号id'],
          ]
        },
        {
          'method': 'POST',
          'name': 'refresh_token',
          'desc': '刷新token',
          'group': '!Login',
          'url': 'https://xxx/api/v1/refresh_token',
          'is_json_params': true,
          'params': [
            ['refresh_token', '', 'refresh_token'],
          ],
          'response': [
            new common.RspHead(),
            ['access_token', '', 'access_token JWT格式'],
            ['refresh_token', '', '刷新令牌'],
            ['expires_in', 0, 'access_token有效期'],
            ['server_time', 0, '服务器utc时间'],
            ['aid', '', '账号id'],
          ]
        },
        {
          'method': 'GET',
          'name': 'user/info',
          'desc': '获取用户信息',
          'group': '!Login',
          'url': 'https://xxx/api/v1/user/info',
          'header': [],
          'response': [
            new common.RspHead(),
            new common.Account()
          ]
        },
      ]
    }

}
